package com.example.configclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description: HelloController <br>
 * date: 2021/5/30 2:44 <br>
 * author: xiehui <br>
 * version: 1.0 <br>
 */

@RestController
/**
 * 使用post请求访问http://127.0.0.1:8002/actuator/refresh
 * 加上@RefreshScope注解，即可动态刷新配置
 */
@RefreshScope
public class HelloController {
    @Value("${xieh}")
    private String xieh;

    @RequestMapping("/hello")
    public String hello() {
        return xieh;
    }
}
